<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRechargeOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recharge_order', function (Blueprint $table) {
            $table->increments('id');
            $table->string("order_sn")->comment("充值订单号");
            $table->integer("recharge_id")->comment("充值套餐ID");
            $table->integer("user_id")->comment("用户ID");
            $table->integer("sell_id")->comment("销售人员ID");
            $table->decimal("money",10,2)->comment("充值金额");
            $table->integer("is_paid")->default(0)->comment("是否支付");
            $table->dateTime("paid_at")->nullable()->comment("支付时间");
            $table->integer("order_status")->default(0)->comment("订单状态");
            $table->dateTime("order_time")->comment("下单时间");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recharge_order');
    }
}
